package org.JWCB.friend.controller.question;

import jakarta.validation.constraints.NotNull;
import org.JWCB.common.core.domain.vo.R;
import org.JWCB.common.core.domain.vo.TableDataInfo;
import org.JWCB.friend.domain.question.dto.QuestionQueryDto;
import org.JWCB.friend.domain.question.vo.HotQuestionListVo;
import org.JWCB.friend.domain.question.vo.QuestionDetailVo;
import org.JWCB.friend.service.question.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("question")
public class QuestionController {


    @Autowired
    private QuestionService questionService;
    @GetMapping("semiLogin/list")
    public TableDataInfo list(QuestionQueryDto queryDto) {
        return questionService.list(queryDto);
    }


    @GetMapping("detail")
    public R<QuestionDetailVo> detail(Long questionId) {
        return R.ok(questionService.detail(questionId));
    }



    @GetMapping("nextQuestion")
    public R<String> nextQuestion(Long questionId) {
        return R.ok(questionService.nextQuestion(questionId));
    }


    @GetMapping("prevQuestion")
    public R<String> prevQuestion(Long questionId) {
        return R.ok(questionService.prevQuestion(questionId));
    }


    @GetMapping("semiLogin/hotQuestion")
    public R<List<HotQuestionListVo>> hotQuestion() {
        return R.ok(questionService.hotQuestion());
    }
}
